import { View } from "../../../../mvc/core/View";
import { LayerManager } from "../../../manager/LayerManager";
import { ObjCreate } from "../../common/ObjCreate";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GTextFormat } from "../../../../common/GTextFormat";
import { SecTimerView } from "../../common/SecTimerView";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
type int = number;
//class CrossStairButton
    
    export  class CrossStairButton extends View
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            this._btn = ObjCreate.createGLoadedButton(ResFileConst.CrossStairIcon, 0, 0, 60, 50, this);
            this._defTf = new GTextFormat(null, 12, 16777215, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._secTime = new SecTimerView();
            this._secTime.y = 50;
            this._secTime.x = -10;
            this._secTime.width = 80;
            this._secTime.height = 20;
            this._secTime.defaultTextFormat = this._defTf;
            this._secTime.filters = [FilterConst.glowFilter];
            this._secTime.setParse(HTMLUtil.addColor("hh: mm: ss", "#FFFFFF"));
            this._secTime.timeOutHandler = this.onSecTimeOutHandler;
            this.addChild(this._secTime);
            return;
        }

        /* internal  */onSecTimeOutHandler(): void
        {
            this.hide();
            return;
        }

        public updateTime(arg1: int): void
        {
            this._secTime.setLeftTime(arg1);
            this._secTime.defaultTextFormat = this._defTf;
            return;
        }

        /* internal */ /* var */_btn: GLoadedButton;

        /* internal */ /* var */_secTime: SecTimerView;

        /* internal */ /* var */_defTf: GTextFormat;
    }
